<template>
  <div>
    <Header></Header>
    <div class="mybody clearfix">
      <div class="bleft">
        <div class="bl-hd">
          <ul>
            <li class="bl-hd-item" @click="totSquare">话题广场</li>
            <li class="bl-hd-item" @click="totShare">教师资源分享</li>
            <li class="bl-hd-item" @click="tonStudent">新生可了解</li>
            <li class="bl-hd-item" @click="toUsers">用户</li>
          </ul>
        </div>
        <div class="bl-hd2">
          <ul>
            <li class="bl-hd-item2" @click="changeFindType(0)">全部</li>
            <li class="bl-hd-item2" @click="changeFindType(1)">热门</li>
          </ul>
        </div>
        <div class="bl-bd">
          <router-view></router-view>
        </div>
      </div>
      <div class="bright">
        <Others></Others>
      </div>
    </div>
  </div>
</template>

<script>
import Others from "./Others";
export default {
  name: "search",
  data() {
    return {
      mygrade: null,
    };
  },
  components: {
    Others,
  },
  methods: {
    totSquare() {
      sessionStorage.setItem("pBoardId", 0);
      this.$router.push({ name: "tsquare" });
    },
    totShare() {
      sessionStorage.setItem("pBoardId", 1);
      this.$router.push({ name: "tshare" });
    },
    tonStudent() {
      sessionStorage.setItem("pBoardId", 2);
      this.$router.push({ name: "nstudent" });
    },
    toUsers() {
      sessionStorage.setItem("pBoardId", 3);
      this.$router.push({ name: "users" });
    },
    changeFindType(findType) {
      sessionStorage.setItem("findType", findType);
      location.reload();
    },
  },
};
</script>

<style>
.mybody {
  height: 500px;
  width: 80%;
}
/*左侧区域 */
.bleft {
  float: left;
  width: 75%;
  /* height: 1150px; */
  padding-bottom: 20px;
  background-color: #fff;
}
.bl-hd {
  height: 50px;
  background-color: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.bl-hd-item {
  float: left;
  line-height: 48px;
  margin: 0 15px;
  /* padding: 0 5px; */
}
.bl-hd-item:hover {
  cursor: pointer;
  font-weight: 700;
  border-bottom: 2px solid black;
}
.bl-hd2 {
  height: 30px;
  background-color: #fdfdfd;
}
.bl-hd-item2 {
  float: left;
  line-height: 20px;
  margin: 5px 10px;
  padding: 0 5px;
}
.bl-hd-item2:hover {
  cursor: pointer;
  background-color: #f0f0f5;
}
.bl-bd {
  background-color: #fff;
}

.bright {
  float: left;
  width: 23%;
  margin-left: 1%;
  /* background-color: pink; */
  height: 150px;
}
</style>
